//
//  LoginViewController.m
//  QQ界面
//
//  Created by apple on 16/10/26.
//  Copyright © 2016年 LWB. All rights reserved.
//

#import "LoginViewController.h"
#import "RegisteredViewController.h"
#import "LWBtabBarViewController.h"
@interface LoginViewController ()
@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setAllControls];
    // Do any additional setup after loading the view.
}
-(void)setAllControls{
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBarHidden = YES;
    //创建欢迎登录标签
    UILabel *loginLabel = [[UILabel alloc]initWithFrame:CGRectMake(70,90,180, 40)];
    loginLabel.text = @"欢迎使用QQ";
    loginLabel.backgroundColor = [UIColor brownColor];
    loginLabel.textAlignment = NSTextAlignmentCenter;
    loginLabel.font =[UIFont systemFontOfSize:30];
    [self.view addSubview:loginLabel];
    //创建帐号标签
    UILabel *countLabel = [[UILabel alloc]initWithFrame:CGRectMake(30,170,50,30)];
    countLabel.text = @"帐号:";
    countLabel.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:countLabel];
    //创建密码标签
    UILabel *pwdLabel = [[UILabel alloc]initWithFrame:CGRectMake(30,220,50,30)];
    pwdLabel.text = @"密码:";
    pwdLabel.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:pwdLabel];
    //创建帐号输入框
    UITextField *countField = [[UITextField alloc]initWithFrame:CGRectMake(85, 170, 130, 30)];
    countField.placeholder =@"请输入帐号";
    countField.borderStyle = UITextBorderStyleRoundedRect;
    countField.clearButtonMode =UITextFieldViewModeAlways;
    [self.view addSubview:countField];
    //创建密码输入框
    UITextField *pwdField = [[UITextField alloc]initWithFrame:CGRectMake(85, 220, 130, 30)];
    pwdField.placeholder =@"请输入密码";
    pwdField.borderStyle = UITextBorderStyleRoundedRect;
    pwdField.secureTextEntry =YES;
    pwdField.clearButtonMode =UITextFieldViewModeAlways;
    [self.view addSubview:pwdField];
    //创建注册按钮
    UIButton *registeredBut = [[UIButton alloc]initWithFrame:CGRectMake(215, 380, 50, 30)];
    registeredBut.backgroundColor = [UIColor blackColor];
    [registeredBut setTitle:@"注册" forState:UIControlStateNormal];
    [registeredBut setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [registeredBut addTarget:self action:@selector(registeredAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:registeredBut];
    //创建登录按钮
    UIButton *loginBut = [[UIButton alloc]initWithFrame:CGRectMake(120, 300, 50, 30)];
    loginBut.backgroundColor = [UIColor blackColor];
    [loginBut setTitle:@"登录" forState:UIControlStateNormal];
    [loginBut setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [loginBut addTarget:self action:@selector(loginAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:loginBut];
}
-(void)loginAction{
    LWBtabBarViewController *tabBar = [[LWBtabBarViewController alloc]init];
    [self.navigationController presentViewController:tabBar animated:YES completion:nil];
}
-(void)registeredAction{
    RegisteredViewController *regist = [[ RegisteredViewController alloc]init];
    [self.navigationController pushViewController:regist animated:YES];
    self.navigationController.navigationBarHidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
